﻿/******************************************************   
创建者: 梁家健
创建时间: 2017-07-03
修改:
修改时间: 
功能: 导出调拨结果
 ******************************************************/

using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using com.nm.library.Excels;
using NHibernateVertica;
using com.nm;

namespace CommodityTransferAPI.Export
{
    [Export(typeof(ExcelImport))]
    public class NewMvJobMessage : ExcelImport
    {
        public override ExcelImportType Type => ExcelImportType.NEWMVJOBMESSAGE;
        public override Dictionary<string, ImportVerify> DictFields => _dictFields;

        private static readonly Dictionary<string, ImportVerify> _dictFields = new List<ImportVerify> {
            new ImportVerify{ ColumnName="公司代码",FieldName="CompanyID",DataType=typeof(string),VerifyFunc =(e,extra)=> ExcelImportHelper.GetCellMsg(e.CellValue,e.ColName,200,true,true)},
            new ImportVerify{ ColumnName="店铺",FieldName="ShopName",DataType=typeof(string),VerifyFunc =(e,extra)=> ExcelImportHelper.GetCellMsg(e.CellValue,e.ColName,200,true,true)},
            new ImportVerify{ ColumnName="调出SKC数",FieldName="outCountSKC",DataType=typeof(long?),VerifyFunc =(e,extra)=> ExcelImportHelper.GetCellMsg(e.CellValue,e.ColName,100,false,true)},
            new ImportVerify{ ColumnName="调出量",FieldName="outSum" ,DataType=typeof(long?),VerifyFunc=(e,extra)=> ExcelImportHelper.GetCellMsg(e.CellValue,e.ColName,100,false,false)},
            new ImportVerify{ ColumnName="调入量",FieldName="inSum" ,DataType=typeof(long?),VerifyFunc=(e,extra)=> ExcelImportHelper.GetCellMsg(e.CellValue,e.ColName,100,false,false)},
           }.ToDictionary(e => e.ColumnName, e => e);

        public override object SaveImportData(DataTable dt, Dictionary<string, object> extraInfo, int userId)
        {
            throw new NotImplementedException();
        }

        public override DataTable GetExportData(string Keys)
        {
            var handler = new NewOdsErpTmpCalcStockHandler();
            return handler.ReturnTotalMvJobMessage(null, Keys);
        }

  
    }
}
